package com.example.aop;

import com.example.aop.service.OrderService;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:textAspect
 * Package:com.example.aop
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/10-23:05
 * @Version:v1.0
 */
public class  textAspect {
    @Test
    public void testBefore() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-aspects.xml");
//        UserService userService = applicationContext.getBean("userService", UserService.class);
//        userService.login();
//        userService.logout();
        OrderService orderService = applicationContext.getBean("orderService", OrderService.class);
        orderService.generate();
    }
}
